﻿using Basic.FlowCollect;
using Basic.FlowLocalEvent.Model;
using WeDonekRpc.Client.Attr;
using WeDonekRpc.Client.Interface;

namespace Basic.FlowLocalEvent.FlowNode
{
    [LocalEventName("Delete")]
    internal class ClearNodeAuditEmp : IEventHandler<FlowNodeEvent>
    {
        private readonly INodeAuditEmpCollect _AuditEmp;

        public ClearNodeAuditEmp ( INodeAuditEmpCollect auditEmp )
        {
            this._AuditEmp = auditEmp;
        }

        public void HandleEvent ( FlowNodeEvent data, string eventName )
        {
            this._AuditEmp.Clear(data.Node.FlowId, data.Node.Id);
        }
    }
}
